package csdn.chouxiang.li07;

public class Test {
    public static void main(String[] args) {
        
    //实例化匿名抽象类对象+构造器传参
        Animal animal=new Animal("小牛") {

            @Override
            public void eat() {
                System.out.println(super.getName()+"吃东西");
            }

            @Override
            public void sleep() {
                System.out.println(super.getName()+"睡大觉");
            }
            
        };
        animal.eat();
        animal.sleep();

    }
}